User initiated microcode modification

ABSTRACT

An instruction decoding unit in a microcomputer is disclosed having an instruction word capable of being selected by a user to conveniently produce application software while maintaining security. The decoding unit in a microcomputer includes an instruction register for storing instructions fetched from a memory, an instruction decoder for decoding instruction codes of the instructions stored in the instruction register and for designating micro-instructions to be executed, a micro-ROM for outputting a series of the micro-instructions designated by the instruction decoder, and a user instruction selector for selecting or changing the micro-instructions of the micro-ROM in response to user&#39;s selection so as to change the operation of an instruction word.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a microcomputer and its use, and more particularly, to an instruction decoding unit in a microcomputer having an instruction word capable of being selected by a user and a method of encoding/decoding the instruction word.

[0003] 2. Discussion of the Related Art

[0004] Generally, a microcomputer includes a central processing unit (CPU), a memory, peripheral units, and an input/output unit on a chip. Recently, microcomputers have been widely used in household electric appliances, office automation machines, industrial electric machines, and the like.

[0005] The microcomputer allows the CPU to process instructions and data from a memory storing application software selected by a user, and controls the peripheral units and the input/output unit.

[0006] An instruction decoding unit in a conventional microcomputer will be described with reference to the accompanying drawings.

[0007]FIG. 1 is a block diagram illustrating an instruction decoding unit in a conventional microcomputer.

[0008] As shown in FIG. 1, the instruction decoding unit in the conventional microcomputer includes an instruction register 11 for storing instructions fetched through a data bus from a memory that stores application software selected by a user, an instruction decoder 12 for decoding the instructions stored in the instruction register 11 and for designating micro (μ)-instructions to be executed, and a micro read only memory (μ-ROM) 13 for outputting a series of the micro-instructions (combination of control signals) designated by the instruction decoder 12.

[0009] The operation of the instruction decoding unit in the conventional microcomputer will be described below.

[0010] The instruction register 11 stores the instructions fetched from the memory, which stores application software selected by the user, through the data bus. The instruction register 11 outputs the instructions to the instruction decoder 12, if necessary.

[0011] The instruction decoder 12 receives the instructions from the instruction register 11 and a signal NXA from the micro-ROM 13 for designating the next micro-instructions, and designates the micro-instructions of the micro-ROM 13 that are to be executed. That is, a command address from micro-ROM 13 contains the signal NXA, which is used to designate a next instruction code.

[0012] The micro-ROM 13 receives the micro-instructions designated from the instruction decoder 12 and outputs the signal NXA for designating the micro-instructions to be output in the next cycle, and outputs the micro-instructions.

[0013] The micro-instructions of the micro-ROM 13 are input to an arithmetic and logic unit (ALU) and various registers, none of which are shown, to perform designated functions.

[0014] However, the instruction decoding unit in the conventional microcomputer has several problems.

[0015] First, since the conventional microcomputer has fixed instruction sets, it may be impossible for the user to designate a desired instruction word set.

[0016] Second, when a program code of the user is open, it is easy to decode the program code using a fixed instruction map, thereby likely causing security problems for the program.

[0017] Finally, when the user produces application software, it is sometimes impossible to designate an instruction word that is frequently used by the user.

SUMMARY OF THE INVENTION

[0018] The present invention is directed to an instruction decoding unit in a microcomputer that substantially obviates one or more of the problems due to limitations and disadvantages of the related art.

[0019] An object of the present invention is to provide an instruction decoding unit in a microcomputer having an instruction word capable of being selected by a user to conveniently produce application software and maintain security.

[0020] Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

[0021] To achieve these and other advantages and in accordance with the purpose of the present invention, as embodied and broadly described, an instruction decoding unit in a microcomputer according to the present invention includes an instruction register for storing instructions fetched from a memory, an instruction decoder for decoding instruction codes of the instructions stored in the instruction register and designating micro-instructions to be executed, a micro-ROM for outputting a series of the micro-instructions designated by the instruction decoder, and a user instruction selector for selecting or changing the micro-instructions of the micro-ROM in response to user's selection so as to change the operation of an instruction word.

[0022] In another aspect, an instruction decoder in a microcomputer includes an instruction register for storing instructions fetched from a memory, an instruction decoder for decoding instruction codes of the instructions stored in the instruction register and designating micro-instructions to be executed, an instruction code selector connected between the instruction register and the instruction decoder, for allowing a user to select a signal for a plurality of instruction maps, a micro-ROM for outputting a series of the micro-instructions designated by the instruction decoder, and a user instruction selector for selecting or changing the micro-instructions of the micro-ROM in response to user's selection so as to change the operation of an instruction word.

[0023] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are intended to provide further explanation of the invention as claimed.

BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0025] In the drawings:

[0026]FIG. 1 is a block diagram illustrating an instruction decoding unit in a conventional microcomputer;

[0027]FIG. 2 is a block diagram illustrating an instruction decoding unit in a microcomputer according to the first embodiment of the present invention;

[0028]FIG. 3 is a block diagram illustrating an instruction decoding unit in a microcomputer according to the second embodiment of the present invention;

[0029]FIG. 4 shows functions of a user instruction selector according to the present invention; and

[0030]FIG. 5 shows functions of an instruction code selector according to the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0031] Reference will now be made in detail to the preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings.

[0032]FIG. 2 is a block diagram illustrating an instruction decoding unit in a microcomputer according to the first embodiment of the present invention.

[0033] As shown in FIG. 2, an instruction decoding unit in a microcomputer according to the first embodiment of the present invention includes an instruction register 21 for storing instructions fetched through a data bus from a memory in which application software selected by a user, an instruction decoder 22 for decoding instruction codes corresponding to the instructions stored in the instruction register 21 and for designating micro-instructions to be executed, a micro-ROM 23 for outputting a series of the micro-instructions (combination of control signals) from micro-instruction signals designated by the instruction decoder 22, and a user instruction selector 24 for selecting or changing the micro-instructions from the micro-ROM 23 in response to a user selection so as to change the operation of an instruction word.

[0034]FIG. 3 is a block diagram illustrating an instruction decoding unit in a microcomputer according to the second embodiment of the present invention.

[0035] As shown in FIG. 3, an instruction decoding unit in a microcomputer includes an instruction register 31 for storing instructions fetched through a data bus from a memory in which application software selected by a user is stored, an instruction decoder 32 for decoding instruction codes corresponding to the instructions stored in the instruction register 31 and for designating micro-instructions to be executed, an instruction code selector 35 connected between the instruction register 31 and the instruction decoder 32 for allowing a user to select a signal corresponding to at least one of a plurality of instruction maps, a micro-ROM 33 for outputting a series of the micro-instructions (combination of control signals) designated by the instruction decoder 32, and a user instruction selector 34 for selecting or changing the micro-instructions of the micro-ROM 33 in response to a user selection so as to change the operation of an instruction word. Instruction decoder 32 includes an instruction map (not shown). The mask option is an option in which a selection switch may or may not be connected in advance using metal. A particular register is used for selecting one of three (increase, decrease, inversion) (this is an example of selection method). Although the order of the original instruction rarely needs to be recovered, a conversion code may be established/selected by a user or manufacturer to allow simplified deciphering of instructions by decoder 32 and micro-ROM 33 after bits have been rearranged by instruction code selector 35.

[0036]FIG. 4 shows functions of the user instruction selectors (e.g., 24 and 34 of FIGS. 2-3) according to the present invention.

[0037] As shown in FIG. 4, it is assumed that an instruction word such as MOVUS, which enables contents of a particular memory to be fetched to another particular memory, is stored within the micro-ROMs 23 and 33. The instruction word, MOVUS, allows the user to select or change (increase, decrease, and invert) data selectively fetched by the user using the user instruction selectors 24 and 34. For example, using the instruction word MOVUS, it is possible for user “A” to select an automatic increase of data and for user “B” to select automatic decrease of data. As such, if D denotes the MOVUS, the micro-instruction will be D+1 when the user selects an increase, D−1 when the user selects a decrease, and {overscore (D)} when the user selects inversion. In this regard, the user can customize the instruction word.

[0038] The user instruction selectors 24 and 34 allow the user to select the instruction word using a mask option or a particular register. Specifically, the instruction map is selected by map selecting bits determined according to a number of maps. For example, as the map selecting bit has 2 bits in the present invention, four maps (0, 1, 2 and 3) can be selected.

[0039]FIG. 5 shows functions of the instruction code selector according to the present invention.

[0040] As shown in FIG. 5, the instruction code selector 35 receives 8-bit data instructions from the instruction register 31, and outputs those data instructions with two or more map selecting bits. The resulting data, which includes two or more instruction map selecting bits and 8-bit data instructions, is input to the instruction decoder 32. In this manner, the user selects a desired instruction set among a plurality of instruction sets. In addition, to recognize the instruction as a code different from actual executive instruction code output from register 31, instruction code selector 35 changes the relative positions of bits in the received data instructions based on a selected instruction map corresponding to the map selecting bits appended to the end of the output from instruction code selector 35. In other words, the security of a program can be maintained even if the user application code in the memory becomes exposed after instruction code selector 35.

[0041] Some of the advantages achieved through the instruction decoding unit in the microcomputer according to the present invention are described hereinafter.

[0042] First, the user can customize the instruction word having a particular function to conveniently produce application software and maintain security.

[0043] Second, the user can select a desired one among a plurality of the instruction maps customized by the user through the instruction code selector.

[0044] Third, security of the application program can be improved by changing the bit position of the instruction word.

[0045] It will be apparent to those skilled in the art that various modifications and variations can be made in the instruction decoding unit in the microcomputer according to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention covers the modifications and variations of the invention provided they come within the scope of the appended claims and their equivalents. 

1. An instruction decoding unit in a microcomputer comprising: an instruction register storing instructions fetched from a memory; an instruction decoder decoding instruction codes of the instructions stored in the instruction register and for designating micro-instructions to be executed based on the decoded instruction codes; a micro-ROM outputting the micro-instructions designated by the instruction decoder; and a user instruction selector selecting or changing the micro-instructions from the micro-ROM in response to a selection by a user so as to change an operation of an instruction word corresponding to the instruction being fetched without any subsequent intervening storage of the microinstructions in RAM.
 2. The instruction decoding unit in a microcomputer as claimed in claim 1, wherein the user instruction selector selects the micro-instructions using a mask option or a particular register.
 3. An instruction decoding unit in a microcomputer comprising: an instruction register storing instructions fetched from a memory; an instruction decoder decoding instruction codes of the instructions stored in the instruction register and designating micro-instructions to be executed; an instruction code selector, connected between the instruction register and the instruction decoder, allowing a user to select a signal corresponding to at least one of a plurality of instruction maps wherein said instruction code selector is operable to encrypt instruction code; a micro-ROM outputting a series of the micro-instructions designated by the instruction decoder.
 4. The instruction decoding unit in a microcomputer as claimed in claim 3, further comprising: a user instruction selector selecting or changing the micro-instructions of the micro-ROM in response to a selection by a user so as to change the operation of an instruction word.
 5. The instruction decoding unit in a microcomputer as claimed in claim 4, wherein the user instruction selector selects the instructions using a mask option or a particular register.
 6. The instruction decoding unit in a microcomputer as claimed in claim 3, wherein the plurality of instruction maps are two or more.
 7. An instruction decoding unit in a microcomputer, comprising: an instruction code selector generating encrypted instructions by manipulating received instructions; and a decoder decoding instructions corresponding to encrypted instructions received from the instruction code selector.
 8. The instruction decoding unit recited by claim 7, further comprising: a user instruction selector selecting or changing the instructions decoded by the decoder in response to a selection by a user.
 9. An apparatus to provide microcodes comprising: a ROM storing a plurality of microcodes; an instruction processor receiving instructions from a user and instructing the ROM to output a first microcode; and a selector allowing the user to selectively modify the microcodes stored in the ROM, to output a second microcode without any subsequent intervening storage of the microcodes in RAM, the first and second microcodes being combined to form a control signal.
 10. The apparatus of claim 9, wherein the selector outputs the second microcode by increasing, decreasing or inverting the microcodes stored in the ROM.
 11. The apparatus of claim 9, wherein the selector comprises a switch operated by map selecting bits determined according to a number of instruction maps.
 12. The apparatus of claim 9, wherein the instruction processor further comprises: an instruction register storing instructions fetched from a memory; and an instruction decoder decoding instruction codes of the instructions stored in the instruction register and designating micro-instructions to be executed based on the decoded instruction codes.
 13. The apparatus of claim 12, wherein the instruction processor further comprises an instruction code selector, connected between the instruction register and the instruction decoder, allowing a user to select a signal pertaining to a plurality of instruction maps.
 14. The apparatus of claim 13, wherein the instruction code selector rearranges a plurality of bits received from the instruction register based on the instruction maps, and applies a plurality of map selecting bits to the rearranged bits to allow subsequent reconstruction by the instruction decoder.
 15. The instruction code selector of claim 3, wherein said instruction code selector is operable to receive a data instruction from the instruction register, and append map selecting bits to the data instruction, wherein said map selecting bits correspond to an instruction map selected by a user, thereby performing encryption of the instruction code. 